import java.util.Scanner;
public class Text {
    public static long gongyueshu (long num1, long den1) {
        if (den1 == 0) {
            return Math.abs(num1);
        }
        return gongyueshu(den1,num1 % den1);
    }
    public static String doNumber(long num1,long den1) {
        String str = "";
        if (num1 / den1 == 0) {  //整数
            str  = str + num1 / den1;
        }else {
            //求分数 的得化简
            long gongNum = gongyueshu(num1,den1);
            num1 = num1 / gongNum;
            den1 = den1 / gongNum;

            //带分数
            if (num1 / den1 != 0) {
                str += (num1 /den1) + " " + (Math.abs(num1 % den1));
            }else {
                //正常的分数
                str = str + num1;
            }
            str += "/" + den1;
        }
        if (str.charAt(0) != '-') {
            str = str.substring(0,str.length());
        }
        return str;
    }
    //求和
    public static String sumNumber(long num1,long den1,long num2,long den2) {
        num1 = num1 * den2 + num2 * den1;
        den1 = den1 * den2;
        return doNumber(num1,den1);  //化简一下结果
    }
    //差
    public static String cha(long num1,long den1,long num2,long den2) {
        num1 = num1 * den2 - num2 * den1;
        den1 = den2 * den1;
        return doNumber(num1,den1);
    }

    //求乘积
    public static String product(long num1,long den1,long num2,long den2) {
        num1 = num2 * num1;
        den1 = den2 * den1;
        return doNumber(num1,den1);
    }

    //除法

    public static String shan(long num1,long den1,long num2,long den2) {
        //如果除数的分母为0 就返回inf
        if(num2 == 0) {
            return "inf";
        }
        num1 = num1 * den2;
        den1 = den1 * num2;
        //如果求出来小于0 就得把分子分母都转加上负号
        if (den1 < 0) {
            num1 = -num1;
            den1 = -den1;
        }
        return doNumber(num1,den1);
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
            String str = scanner.nextLine();
            String[] parts = str.split(" ");
            long num1 = Long.parseLong(parts[0].split("/")[0]);   //第一个数的分子
            long den1 = Long.parseLong(parts[0].split("/")[1]);   // 第一个数的分母
            long num2 = Long.parseLong(parts[1].split("/")[0]);
            long den2 = Long.parseLong(parts[1].split("/")[1]);

            //先把数变成正常的数  变成字符串
            String  num3 = doNumber(num1,den1);
            String num4 = doNumber(num2,den2);
            String sum = sumNumber(num1,den1,num2,den2);
            String cha = cha(num1,den1,num2,den2);
            String product = product(num1,den1,num2,den2);
            String chu = shan(num1,den1,num2,den2);
            //输出
            System.out.print(num3+" "+"+"+" "+num4+" "+"="+" "+sum + "<br/>");
            System.out.print(num3+" "+"-"+" "+num4+" "+"="+" "+cha + "<br/>");
            System.out.print(num3+" "+"*"+" "+num4+" "+"="+" "+product + "<br/>");
            System.out.print(num3+" "+"/"+" "+num4+" "+"="+" "+chu);


    }
}
